From 6094cf035d2ecac01406e4a21740ee0fe594d0c5 Mon Sep 17 00:00:00 2001 From: robertl Date: Fri, 7 Aug 2009 05:00:52 +0000 Subject: [PATCH] Misc minor distracting stupid stuff to placate MSVC. --- defs.h | 2 ++ delbin.c | 5 +++++ mtk_logger.c | 2 +- skytraq.c | 5 +++-- v900.c | 3 ++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/defs.h b/defs.h index 85f1f8633..89a245599 100644 --- a/defs.h +++ b/defs.h @@ -110,8 +110,10 @@ # if _MSC_VER # pragma warning(disable:4244) # endif +#if !defined _CRT_SECURE_NO_DEPRECATE # define _CRT_SECURE_NO_DEPRECATE 1 #endif +#endif /* Pathname separator character */ #if __WIN32__ diff --git a/delbin.c b/delbin.c index 4dde83be8..760892e9f 100644 --- a/delbin.c +++ b/delbin.c @@ -2150,6 +2150,11 @@ ff_vecs_t delbin_vecs = { #define WIN32_LEAN_AND_MEAN #include #include +// If hidsdi.h is not found, you need to download the Windows Driver Kit, +// from http://www.microsoft.com/whdc/Devtools/wdk/default.mspx +// You need to install 'build environments' and 'tools' from the SDK and +// follow the instructions in the Install.html to get MSVC to find the right +// headers and libraries. #include static HANDLE hid_handle; diff --git a/mtk_logger.c b/mtk_logger.c index 4b29bf0f5..32fd76a3c 100644 --- a/mtk_logger.c +++ b/mtk_logger.c @@ -465,7 +465,7 @@ static void mtk_read(void){ unsigned char crc, *data = NULL; int cmdLen, j, bsize, i, len, ff_len, null_len, rc, init_scan, retry_cnt, log_enabled; unsigned int line_size, data_size, data_addr, addr, addr_max; - long dsize, dpos = 0; + unsigned long dsize, dpos = 0; FILE *dout; char *fusage = NULL; diff --git a/skytraq.c b/skytraq.c index e463b5fd8..8918d1c3e 100644 --- a/skytraq.c +++ b/skytraq.c @@ -112,6 +112,7 @@ rd_char(int *errors) } } fatal(MYNAME ": Too many read errors on serial port\n"); + return -1; } static int @@ -455,7 +456,7 @@ skytraq_get_log_buffer_status(gbuint32 *log_wr_ptr, gbuint16 *sectors_free, gbui } /* reads 32-bit "middle-endian" fields */ -static unsigned int me_read32(const void *p) { +static unsigned int me_read32(const unsigned char *p) { return ((unsigned)be_read16(p+2) << 16) | ((unsigned)be_read16(p)); } @@ -821,7 +822,7 @@ skytraq_read_tracks(route_head *track) int i, t, s, rc, got_bytes; int read_at_once = MAX(atoi(opt_read_at_once), 1); int sectors_read, multi_read_supported = 1; - gbuint8 *buffer; + gbuint8 *buffer = NULL; state_init(&st); st.route_head = track; diff --git a/v900.c b/v900.c index ea2423d47..f926e7be0 100644 --- a/v900.c +++ b/v900.c @@ -351,8 +351,9 @@ Advanced mode: INDEX,TAG,DATE,TIME,LATITUDE N/S,LONGITUDE E/W,HEIGHT,SPEED,HEADI track_add_wpt(track, wpt); if(line.bas.common.tag != 'T') { + waypoint *wpt2; assert(line.bas.common.tag == 'C' || line.bas.common.tag == 'V'); - waypoint *wpt2 = waypt_dupe(wpt); + wpt2 = waypt_dupe(wpt); if(line.bas.common.tag == 'V') // waypoint with voice recording? { char vox_file_name[sizeof(line.adv.vox)+5]; -- 2.30.2